package com.yun.zf.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yun.zf.system.mapper.SysActivityMapper;
import com.yun.zf.system.service.SysActivityService;
import com.yun.zf.common.admin.model.activity.ActivityAddMo;
import com.yun.zf.common.app.domain.SysActivity;
import com.yun.zf.common.mapstruct.admin.ActivityMapper;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * <p>
 * 活动表 服务实现类
 * </p>
 *
 * @author cj
 * @since 2021-05-31
 */
@Service
public class SysActivityServiceImpl extends ServiceImpl<SysActivityMapper, SysActivity> implements SysActivityService {

    @Override
    public int addOneActivity(ActivityAddMo activityAddMo) {
       SysActivity activity = ActivityMapper.INSTANCE.addOneActivityTo(activityAddMo);
       activity.setCreateTime(new Date());
        return baseMapper.insert(activity);
    }
}
